public class Test {
    public static void fun(){
        int a=10;
        if(a==10){
            throw new NullPointerException();
        }

    }
    public static void main(String[] args) {
        try{
           fun();

        }catch(NullPointerException e){
            e.printStackTrace();
            System.out.println("异常");
        }
    }
}
